﻿@model Yunwei.Web.Areas.RRShop.Models.RestaurantIngredientViewModel

@{
    ViewBag.Title = "Add";
}

<link href="~/Content/cropper.min.css" rel="stylesheet" />
<script src="~/Scripts/cropper.min.js"></script>
<script src="~/Scripts/inside.js"></script>
<script src="~/Scripts/lbs_map.js"></script>

<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">添加新食材</h1>
    </div>
    <div class="col-lg-6">
        <a class="btn btn-primary btn-circle" href="/RRShop/Ingredient/List/@ViewBag.Id"><i class="fa fa-reply"></i></a>
    </div>
</div>

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Cost, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Cost, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Cost, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Stock, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Stock, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Stock, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Unit, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model=>model.Unit,Model.UnitItems,new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Unit, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Vendor_Id, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.Vendor_Id, Model.VendorItems, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Vendor_Id, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.HiddenFor(model=>model.Restaurant_Id);
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="提交" class="btn btn-success" />
            </div>
        </div>
    </div>
}

